home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 October / enter-2005-10.iso / files / jedit42install.exe / {app} / macros / Misc / Display_Actions.bsh < prev    next >
Encoding:
Text File  |  2004-08-29  |  2.4 KB  |  77 lines

  1. /*
  2.  * Display_Actions.bsh - Displays a list of all the actions known to jEdit
  3.  * categorised by ActionSet.
  4.  *
  5.  * Copyright (C) 2002 Lee Turner (lee@leeturner.org)
  6.  * Version 1.0
  7.  *
  8.  * :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1:
  9.  *
  10.  * This program is free software; you can redistribute it and/or
  11.  * modify it under the terms of the GNU General Public License
  12.  * as published by the Free Software Foundation; either version 2
  13.  * of the License, or any later version.
  14.  *
  15.  * This program is distributed in the hope that it will be useful,
  16.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.  * GNU General Public License for more details.
  19.  *
  20.  * You should have received a copy of the GNU General Public License
  21.  * along with this program; if not, write to the Free Software
  22.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  23.  */
  24.  
  25. StringBuffer buf = new StringBuffer();
  26. buf.append("The jEdit action bar can be opened via the Utilities menu and is usually\n");
  27. buf.append("assigned to the C+ENTER keyboard shortcut.\n\n");
  28.  
  29. actionSets = jEdit.getActionSets();
  30. Arrays.sort(actionSets,new MiscUtilities.StringICaseCompare());
  31.  
  32. for(i = 0; i < actionSets.length; i++)
  33. {
  34.     ActionSet actionSet = actionSets[i];
  35.     if(actionSet.getActionCount() != 0)
  36.     {
  37.         buf.append("{{{ " + actionSet.getLabel() + "\n");
  38.  
  39.         actions = actionSet.getActionNames();
  40.         Arrays.sort(actions,new MiscUtilities.StringICaseCompare());
  41.  
  42.         for(j = 0; j < actions.length; j++)
  43.         {
  44.             String name = actions[j];
  45.             String label = jEdit.getProperty(actions[j] + ".label");
  46.             if(label == null)
  47.                 label = "<no label>";
  48.             else
  49.                 label = GUIUtilities.prettifyMenuLabel(label);
  50.             buf.append(name + " : " + label + "\n");
  51.         }
  52.         buf.append("}}}\n\n");
  53.     }
  54. }
  55. buffer = jEdit.newFile(view);
  56. buffer.insert(0,buf.toString());
  57. textArea.setCaretPosition(0);
  58.  
  59. buffer.setStringProperty("folding","explicit");
  60. buffer.setIntegerProperty("collapseFolds",1);
  61. buffer.propertiesChanged();
  62.  
  63. /*
  64. Macro index data (in DocBook format)
  65.  
  66. <listitem>
  67.     <para><filename>Display_Actions.bsh</filename></para>
  68.     <abstract><para>
  69.         Displays a list of all the actions known to jEdit categorised by
  70.         their action set.
  71.     </para></abstract>
  72.     <para>
  73.         This macro can be a useful reference if you want to use the jEdit 4.2 action bar.
  74.     </para>
  75. </listitem>
  76. */
  77.